package com.iknow;

import com.iknow.http.HttpException;
import com.iknow.http.Response;
import com.iknow.http.ResponseException;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;

public class CommentResponse extends IKnowResponse
{
  private static final long serialVersionUID = -262421703L;
  private String mCommentID;
  private String mData;
  private String mDate;
  private String mJID;
  private String mUserName;

  public CommentResponse(Response paramResponse)
    throws HttpException
  {
    init(paramResponse.asJSONArray());
  }

  public CommentResponse(JSONArray paramJSONArray)
    throws HttpException
  {
    init(paramJSONArray);
  }

  public static List<CommentResponse> CommentResponses(Response paramResponse)
    throws HttpException
  {
    JSONArray localJSONArray;
    try
    {
      localJSONArray = paramResponse.asJSONArray();
      ArrayList localArrayList = new ArrayList(localJSONArray.length());
      int i = 0;
      if (i >= localArrayList.size())
        return localArrayList;
      localArrayList.add(new CommentResponse(localJSONArray.getJSONArray(i)));
      ++i;
    }
    catch (ResponseException localResponseException)
    {
      throw new HttpException(localResponseException);
    }
    catch (JSONException localJSONException)
    {
      throw new HttpException(localJSONException);
    }
  }

  private void init(JSONArray paramJSONArray)
    throws HttpException
  {
    try
    {
      this.mCommentID = paramJSONArray.getString(0);
      this.mDate = paramJSONArray.getString(1);
      this.mData = paramJSONArray.getString(2);
      this.mJID = paramJSONArray.getString(3);
      this.mUserName = paramJSONArray.getString(4);
      return;
    }
    catch (JSONException localJSONException)
    {
      throw new HttpException(localJSONException);
    }
  }

  public String getCommentID()
  {
    return this.mCommentID;
  }

  public String getData()
  {
    return this.mData;
  }

  public String getDate()
  {
    return this.mDate;
  }

  public String getJID()
  {
    return this.mJID;
  }

  public String getName()
  {
    return this.mUserName;
  }
}